package com.gzhu.knowledgeAdmin.controller;

import com.gzhu.knowledgeAdmin.common.result.R;
import com.gzhu.knowledgeAdmin.service.BillService;
import com.gzhu.knowledgeAdmin.service.DailyBillService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/bill")
public class BillController {

    @Resource
    private BillService billService;

    @Resource
    private DailyBillService dailyBillService;

    @PostMapping("/find/{fGsid}")
    public R find(@PathVariable String fGsid)
    {
        return R.ok(billService.getBill(fGsid));
    }

    @PostMapping("/findDailyBill/{fGsid}/{month}")
    public R findDailyBill(@PathVariable String fGsid, @PathVariable String month)
    {
        return R.ok(dailyBillService.getDailyBillBill(fGsid,month));
    }

}
